\(\int (a+b \sec (c+d x))^2 \tan ^9(c+d x) \, dx\) [271]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 21, antiderivative size = 185 \[ \int (a+b \sec (c+d x))^2 \tan ^9(c+d x) \, dx=-\frac {a^2 \log (\cos (c+d x))}{d}+\frac {2 a b \sec (c+d x)}{d}-\frac {2 a^2 \sec ^2(c+d x)}{d}-\frac {8 a b \sec ^3(c+d x)}{3 d}+\frac {3 a^2 \sec ^4(c+d x)}{2 d}+\frac {12 a b \sec ^5(c+d x)}{5 d}-\frac {2 a^2 \sec ^6(c+d x)}{3 d}-\frac {8 a b \sec ^7(c+d x)}{7 d}+\frac {a^2 \sec ^8(c+d x)}{8 d}+\frac {2 a b \sec ^9(c+d x)}{9 d}+\frac {b^2 \tan ^{10}(c+d x)}{10 d} \]

[Out]

-a^2*ln(cos(d*x+c))/d+2*a*b*sec(d*x+c)/d-2*a^2*sec(d*x+c)^2/d-8/3*a*b*sec(d*x+c)^3/d+3/2*a^2*sec(d*x+c)^4/d+12
/5*a*b*sec(d*x+c)^5/d-2/3*a^2*sec(d*x+c)^6/d-8/7*a*b*sec(d*x+c)^7/d+1/8*a^2*sec(d*x+c)^8/d+2/9*a*b*sec(d*x+c)^
9/d+1/10*b^2*tan(d*x+c)^10/d

Rubi [A] (verified)

Time = 0.16 (sec) , antiderivative size = 217, normalized size of antiderivative = 1.17, number of steps used = 3, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.095, Rules used = {3970, 962} \[ \int (a+b \sec (c+d x))^2 \tan ^9(c+d x) \, dx=\frac {\left (a^2-4 b^2\right ) \sec ^8(c+d x)}{8 d}-\frac {\left (2 a^2-3 b^2\right ) \sec ^6(c+d x)}{3 d}+\frac {\left (3 a^2-2 b^2\right ) \sec ^4(c+d x)}{2 d}-\frac {\left (4 a^2-b^2\right ) \sec ^2(c+d x)}{2 d}-\frac {a^2 \log (\cos (c+d x))}{d}+\frac {2 a b \sec ^9(c+d x)}{9 d}-\frac {8 a b \sec ^7(c+d x)}{7 d}+\frac {12 a b \sec ^5(c+d x)}{5 d}-\frac {8 a b \sec ^3(c+d x)}{3 d}+\frac {2 a b \sec (c+d x)}{d}+\frac {b^2 \sec ^{10}(c+d x)}{10 d} \]

[In]

Int[(a + b*Sec[c + d*x])^2*Tan[c + d*x]^9,x]

[Out]

-((a^2*Log[Cos[c + d*x]])/d) + (2*a*b*Sec[c + d*x])/d - ((4*a^2 - b^2)*Sec[c + d*x]^2)/(2*d) - (8*a*b*Sec[c +
d*x]^3)/(3*d) + ((3*a^2 - 2*b^2)*Sec[c + d*x]^4)/(2*d) + (12*a*b*Sec[c + d*x]^5)/(5*d) - ((2*a^2 - 3*b^2)*Sec[
c + d*x]^6)/(3*d) - (8*a*b*Sec[c + d*x]^7)/(7*d) + ((a^2 - 4*b^2)*Sec[c + d*x]^8)/(8*d) + (2*a*b*Sec[c + d*x]^
9)/(9*d) + (b^2*Sec[c + d*x]^10)/(10*d)

Rule 962

Int[((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))^(n_)*((a_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIn
tegrand[(d + e*x)^m*(f + g*x)^n*(a + c*x^2)^p, x], x] /; FreeQ[{a, c, d, e, f, g}, x] && NeQ[e*f - d*g, 0] &&
NeQ[c*d^2 + a*e^2, 0] && IGtQ[p, 0] && (IGtQ[m, 0] || (EqQ[m, -2] && EqQ[p, 1] && EqQ[d, 0]))

Rule 3970

Int[cot[(c_.) + (d_.)*(x_)]^(m_.)*(csc[(c_.) + (d_.)*(x_)]*(b_.) + (a_))^(n_), x_Symbol] :> Dist[-(-1)^((m - 1
)/2)/(d*b^(m - 1)), Subst[Int[(b^2 - x^2)^((m - 1)/2)*((a + x)^n/x), x], x, b*Csc[c + d*x]], x] /; FreeQ[{a, b
, c, d, n}, x] && IntegerQ[(m - 1)/2] && NeQ[a^2 - b^2, 0]

Rubi steps \begin{align*} \text {integral}& = \frac {\text {Subst}\left (\int \frac {(a+x)^2 \left (b^2-x^2\right )^4}{x} \, dx,x,b \sec (c+d x)\right )}{b^8 d} \\ & = \frac {\text {Subst}\left (\int \left (2 a b^8+\frac {a^2 b^8}{x}-b^6 \left (4 a^2-b^2\right ) x-8 a b^6 x^2+2 b^4 \left (3 a^2-2 b^2\right ) x^3+12 a b^4 x^4-2 b^2 \left (2 a^2-3 b^2\right ) x^5-8 a b^2 x^6+\left (a^2-4 b^2\right ) x^7+2 a x^8+x^9\right ) \, dx,x,b \sec (c+d x)\right )}{b^8 d} \\ & = -\frac {a^2 \log (\cos (c+d x))}{d}+\frac {2 a b \sec (c+d x)}{d}-\frac {\left (4 a^2-b^2\right ) \sec ^2(c+d x)}{2 d}-\frac {8 a b \sec ^3(c+d x)}{3 d}+\frac {\left (3 a^2-2 b^2\right ) \sec ^4(c+d x)}{2 d}+\frac {12 a b \sec ^5(c+d x)}{5 d}-\frac {\left (2 a^2-3 b^2\right ) \sec ^6(c+d x)}{3 d}-\frac {8 a b \sec ^7(c+d x)}{7 d}+\frac {\left (a^2-4 b^2\right ) \sec ^8(c+d x)}{8 d}+\frac {2 a b \sec ^9(c+d x)}{9 d}+\frac {b^2 \sec ^{10}(c+d x)}{10 d} \\ \end{align*}

Mathematica [A] (verified)

Time = 1.17 (sec) , antiderivative size = 173, normalized size of antiderivative = 0.94 \[ \int (a+b \sec (c+d x))^2 \tan ^9(c+d x) \, dx=\frac {-2520 a^2 \log (\cos (c+d x))+5040 a b \sec (c+d x)-1260 \left (4 a^2-b^2\right ) \sec ^2(c+d x)-6720 a b \sec ^3(c+d x)+1260 \left (3 a^2-2 b^2\right ) \sec ^4(c+d x)+6048 a b \sec ^5(c+d x)-840 \left (2 a^2-3 b^2\right ) \sec ^6(c+d x)-2880 a b \sec ^7(c+d x)+315 \left (a^2-4 b^2\right ) \sec ^8(c+d x)+560 a b \sec ^9(c+d x)+252 b^2 \sec ^{10}(c+d x)}{2520 d} \]

[In]

Integrate[(a + b*Sec[c + d*x])^2*Tan[c + d*x]^9,x]

[Out]

(-2520*a^2*Log[Cos[c + d*x]] + 5040*a*b*Sec[c + d*x] - 1260*(4*a^2 - b^2)*Sec[c + d*x]^2 - 6720*a*b*Sec[c + d*
x]^3 + 1260*(3*a^2 - 2*b^2)*Sec[c + d*x]^4 + 6048*a*b*Sec[c + d*x]^5 - 840*(2*a^2 - 3*b^2)*Sec[c + d*x]^6 - 28
80*a*b*Sec[c + d*x]^7 + 315*(a^2 - 4*b^2)*Sec[c + d*x]^8 + 560*a*b*Sec[c + d*x]^9 + 252*b^2*Sec[c + d*x]^10)/(
2520*d)

Maple [A] (verified)

Time = 6.16 (sec) , antiderivative size = 133, normalized size of antiderivative = 0.72

method result size
parts \(\frac {a^{2} \left (\frac {\tan \left (d x +c \right )^{8}}{8}-\frac {\tan \left (d x +c \right )^{6}}{6}+\frac {\tan \left (d x +c \right )^{4}}{4}-\frac {\tan \left (d x +c \right )^{2}}{2}+\frac {\ln \left (1+\tan \left (d x +c \right )^{2}\right )}{2}\right )}{d}+\frac {b^{2} \tan \left (d x +c \right )^{10}}{10 d}+\frac {2 a b \left (\frac {\sec \left (d x +c \right )^{9}}{9}-\frac {4 \sec \left (d x +c \right )^{7}}{7}+\frac {6 \sec \left (d x +c \right )^{5}}{5}-\frac {4 \sec \left (d x +c \right )^{3}}{3}+\sec \left (d x +c \right )\right )}{d}\) \(133\)
derivativedivides \(\frac {\frac {b^{2} \sec \left (d x +c \right )^{10}}{10}+\frac {2 a b \sec \left (d x +c \right )^{9}}{9}+\frac {a^{2} \sec \left (d x +c \right )^{8}}{8}-\frac {b^{2} \sec \left (d x +c \right )^{8}}{2}-\frac {8 a b \sec \left (d x +c \right )^{7}}{7}-\frac {2 a^{2} \sec \left (d x +c \right )^{6}}{3}+b^{2} \sec \left (d x +c \right )^{6}+\frac {12 a b \sec \left (d x +c \right )^{5}}{5}+\frac {3 a^{2} \sec \left (d x +c \right )^{4}}{2}-b^{2} \sec \left (d x +c \right )^{4}-\frac {8 a b \sec \left (d x +c \right )^{3}}{3}-2 a^{2} \sec \left (d x +c \right )^{2}+\frac {\sec \left (d x +c \right )^{2} b^{2}}{2}+2 a b \sec \left (d x +c \right )+a^{2} \ln \left (\sec \left (d x +c \right )\right )}{d}\) \(191\)
default \(\frac {\frac {b^{2} \sec \left (d x +c \right )^{10}}{10}+\frac {2 a b \sec \left (d x +c \right )^{9}}{9}+\frac {a^{2} \sec \left (d x +c \right )^{8}}{8}-\frac {b^{2} \sec \left (d x +c \right )^{8}}{2}-\frac {8 a b \sec \left (d x +c \right )^{7}}{7}-\frac {2 a^{2} \sec \left (d x +c \right )^{6}}{3}+b^{2} \sec \left (d x +c \right )^{6}+\frac {12 a b \sec \left (d x +c \right )^{5}}{5}+\frac {3 a^{2} \sec \left (d x +c \right )^{4}}{2}-b^{2} \sec \left (d x +c \right )^{4}-\frac {8 a b \sec \left (d x +c \right )^{3}}{3}-2 a^{2} \sec \left (d x +c \right )^{2}+\frac {\sec \left (d x +c \right )^{2} b^{2}}{2}+2 a b \sec \left (d x +c \right )+a^{2} \ln \left (\sec \left (d x +c \right )\right )}{d}\) \(191\)
risch \(i a^{2} x +\frac {2 i a^{2} c}{d}+\frac {4 a b \,{\mathrm e}^{19 i \left (d x +c \right )}-8 a^{2} {\mathrm e}^{18 i \left (d x +c \right )}+2 b^{2} {\mathrm e}^{18 i \left (d x +c \right )}+\frac {44 a b \,{\mathrm e}^{17 i \left (d x +c \right )}}{3}-40 a^{2} {\mathrm e}^{16 i \left (d x +c \right )}+\frac {1072 a b \,{\mathrm e}^{15 i \left (d x +c \right )}}{15}-\frac {368 a^{2} {\mathrm e}^{14 i \left (d x +c \right )}}{3}+24 b^{2} {\mathrm e}^{14 i \left (d x +c \right )}+\frac {880 a b \,{\mathrm e}^{13 i \left (d x +c \right )}}{7}-\frac {680 a^{2} {\mathrm e}^{12 i \left (d x +c \right )}}{3}+\frac {12616 a b \,{\mathrm e}^{11 i \left (d x +c \right )}}{63}-272 a^{2} {\mathrm e}^{10 i \left (d x +c \right )}+\frac {252 b^{2} {\mathrm e}^{10 i \left (d x +c \right )}}{5}+\frac {12616 a b \,{\mathrm e}^{9 i \left (d x +c \right )}}{63}-\frac {680 a^{2} {\mathrm e}^{8 i \left (d x +c \right )}}{3}+\frac {880 a b \,{\mathrm e}^{7 i \left (d x +c \right )}}{7}-\frac {368 a^{2} {\mathrm e}^{6 i \left (d x +c \right )}}{3}+24 b^{2} {\mathrm e}^{6 i \left (d x +c \right )}+\frac {1072 a b \,{\mathrm e}^{5 i \left (d x +c \right )}}{15}-40 a^{2} {\mathrm e}^{4 i \left (d x +c \right )}+\frac {44 a b \,{\mathrm e}^{3 i \left (d x +c \right )}}{3}-8 a^{2} {\mathrm e}^{2 i \left (d x +c \right )}+2 b^{2} {\mathrm e}^{2 i \left (d x +c \right )}+4 a b \,{\mathrm e}^{i \left (d x +c \right )}}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{10}}-\frac {a^{2} \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}{d}\) \(384\)

[In]

int((a+b*sec(d*x+c))^2*tan(d*x+c)^9,x,method=_RETURNVERBOSE)

[Out]

a^2/d*(1/8*tan(d*x+c)^8-1/6*tan(d*x+c)^6+1/4*tan(d*x+c)^4-1/2*tan(d*x+c)^2+1/2*ln(1+tan(d*x+c)^2))+1/10*b^2*ta
n(d*x+c)^10/d+2*a*b/d*(1/9*sec(d*x+c)^9-4/7*sec(d*x+c)^7+6/5*sec(d*x+c)^5-4/3*sec(d*x+c)^3+sec(d*x+c))

Fricas [A] (verification not implemented)

none

Time = 0.31 (sec) , antiderivative size = 181, normalized size of antiderivative = 0.98 \[ \int (a+b \sec (c+d x))^2 \tan ^9(c+d x) \, dx=-\frac {2520 \, a^{2} \cos \left (d x + c\right )^{10} \log \left (-\cos \left (d x + c\right )\right ) - 5040 \, a b \cos \left (d x + c\right )^{9} + 6720 \, a b \cos \left (d x + c\right )^{7} + 1260 \, {\left (4 \, a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{8} - 6048 \, a b \cos \left (d x + c\right )^{5} - 1260 \, {\left (3 \, a^{2} - 2 \, b^{2}\right )} \cos \left (d x + c\right )^{6} + 2880 \, a b \cos \left (d x + c\right )^{3} + 840 \, {\left (2 \, a^{2} - 3 \, b^{2}\right )} \cos \left (d x + c\right )^{4} - 560 \, a b \cos \left (d x + c\right ) - 315 \, {\left (a^{2} - 4 \, b^{2}\right )} \cos \left (d x + c\right )^{2} - 252 \, b^{2}}{2520 \, d \cos \left (d x + c\right )^{10}} \]

[In]

integrate((a+b*sec(d*x+c))^2*tan(d*x+c)^9,x, algorithm="fricas")

[Out]

-1/2520*(2520*a^2*cos(d*x + c)^10*log(-cos(d*x + c)) - 5040*a*b*cos(d*x + c)^9 + 6720*a*b*cos(d*x + c)^7 + 126
0*(4*a^2 - b^2)*cos(d*x + c)^8 - 6048*a*b*cos(d*x + c)^5 - 1260*(3*a^2 - 2*b^2)*cos(d*x + c)^6 + 2880*a*b*cos(
d*x + c)^3 + 840*(2*a^2 - 3*b^2)*cos(d*x + c)^4 - 560*a*b*cos(d*x + c) - 315*(a^2 - 4*b^2)*cos(d*x + c)^2 - 25
2*b^2)/(d*cos(d*x + c)^10)

Sympy [A] (verification not implemented)

Time = 2.48 (sec) , antiderivative size = 314, normalized size of antiderivative = 1.70 \[ \int (a+b \sec (c+d x))^2 \tan ^9(c+d x) \, dx=\begin {cases} \frac {a^{2} \log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 d} + \frac {a^{2} \tan ^{8}{\left (c + d x \right )}}{8 d} - \frac {a^{2} \tan ^{6}{\left (c + d x \right )}}{6 d} + \frac {a^{2} \tan ^{4}{\left (c + d x \right )}}{4 d} - \frac {a^{2} \tan ^{2}{\left (c + d x \right )}}{2 d} + \frac {2 a b \tan ^{8}{\left (c + d x \right )} \sec {\left (c + d x \right )}}{9 d} - \frac {16 a b \tan ^{6}{\left (c + d x \right )} \sec {\left (c + d x \right )}}{63 d} + \frac {32 a b \tan ^{4}{\left (c + d x \right )} \sec {\left (c + d x \right )}}{105 d} - \frac {128 a b \tan ^{2}{\left (c + d x \right )} \sec {\left (c + d x \right )}}{315 d} + \frac {256 a b \sec {\left (c + d x \right )}}{315 d} + \frac {b^{2} \tan ^{8}{\left (c + d x \right )} \sec ^{2}{\left (c + d x \right )}}{10 d} - \frac {b^{2} \tan ^{6}{\left (c + d x \right )} \sec ^{2}{\left (c + d x \right )}}{10 d} + \frac {b^{2} \tan ^{4}{\left (c + d x \right )} \sec ^{2}{\left (c + d x \right )}}{10 d} - \frac {b^{2} \tan ^{2}{\left (c + d x \right )} \sec ^{2}{\left (c + d x \right )}}{10 d} + \frac {b^{2} \sec ^{2}{\left (c + d x \right )}}{10 d} & \text {for}\: d \neq 0 \\x \left (a + b \sec {\left (c \right )}\right )^{2} \tan ^{9}{\left (c \right )} & \text {otherwise} \end {cases} \]

[In]

integrate((a+b*sec(d*x+c))**2*tan(d*x+c)**9,x)

[Out]

Piecewise((a**2*log(tan(c + d*x)**2 + 1)/(2*d) + a**2*tan(c + d*x)**8/(8*d) - a**2*tan(c + d*x)**6/(6*d) + a**
2*tan(c + d*x)**4/(4*d) - a**2*tan(c + d*x)**2/(2*d) + 2*a*b*tan(c + d*x)**8*sec(c + d*x)/(9*d) - 16*a*b*tan(c
 + d*x)**6*sec(c + d*x)/(63*d) + 32*a*b*tan(c + d*x)**4*sec(c + d*x)/(105*d) - 128*a*b*tan(c + d*x)**2*sec(c +
 d*x)/(315*d) + 256*a*b*sec(c + d*x)/(315*d) + b**2*tan(c + d*x)**8*sec(c + d*x)**2/(10*d) - b**2*tan(c + d*x)
**6*sec(c + d*x)**2/(10*d) + b**2*tan(c + d*x)**4*sec(c + d*x)**2/(10*d) - b**2*tan(c + d*x)**2*sec(c + d*x)**
2/(10*d) + b**2*sec(c + d*x)**2/(10*d), Ne(d, 0)), (x*(a + b*sec(c))**2*tan(c)**9, True))

Maxima [A] (verification not implemented)

none

Time = 0.20 (sec) , antiderivative size = 174, normalized size of antiderivative = 0.94 \[ \int (a+b \sec (c+d x))^2 \tan ^9(c+d x) \, dx=-\frac {2520 \, a^{2} \log \left (\cos \left (d x + c\right )\right ) - \frac {5040 \, a b \cos \left (d x + c\right )^{9} - 6720 \, a b \cos \left (d x + c\right )^{7} - 1260 \, {\left (4 \, a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{8} + 6048 \, a b \cos \left (d x + c\right )^{5} + 1260 \, {\left (3 \, a^{2} - 2 \, b^{2}\right )} \cos \left (d x + c\right )^{6} - 2880 \, a b \cos \left (d x + c\right )^{3} - 840 \, {\left (2 \, a^{2} - 3 \, b^{2}\right )} \cos \left (d x + c\right )^{4} + 560 \, a b \cos \left (d x + c\right ) + 315 \, {\left (a^{2} - 4 \, b^{2}\right )} \cos \left (d x + c\right )^{2} + 252 \, b^{2}}{\cos \left (d x + c\right )^{10}}}{2520 \, d} \]

[In]

integrate((a+b*sec(d*x+c))^2*tan(d*x+c)^9,x, algorithm="maxima")

[Out]

-1/2520*(2520*a^2*log(cos(d*x + c)) - (5040*a*b*cos(d*x + c)^9 - 6720*a*b*cos(d*x + c)^7 - 1260*(4*a^2 - b^2)*
cos(d*x + c)^8 + 6048*a*b*cos(d*x + c)^5 + 1260*(3*a^2 - 2*b^2)*cos(d*x + c)^6 - 2880*a*b*cos(d*x + c)^3 - 840
*(2*a^2 - 3*b^2)*cos(d*x + c)^4 + 560*a*b*cos(d*x + c) + 315*(a^2 - 4*b^2)*cos(d*x + c)^2 + 252*b^2)/cos(d*x +
 c)^10)/d

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 489 vs. \(2 (169) = 338\).

Time = 5.92 (sec) , antiderivative size = 489, normalized size of antiderivative = 2.64 \[ \int (a+b \sec (c+d x))^2 \tan ^9(c+d x) \, dx=\frac {2520 \, a^{2} \log \left ({\left | -\frac {\cos \left (d x + c\right ) - 1}{\cos \left (d x + c\right ) + 1} + 1 \right |}\right ) - 2520 \, a^{2} \log \left ({\left | -\frac {\cos \left (d x + c\right ) - 1}{\cos \left (d x + c\right ) + 1} - 1 \right |}\right ) + \frac {7381 \, a^{2} + 4096 \, a b + \frac {78850 \, a^{2} {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} + \frac {40960 \, a b {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} + \frac {382545 \, a^{2} {\left (\cos \left (d x + c\right ) - 1\right )}^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} + \frac {184320 \, a b {\left (\cos \left (d x + c\right ) - 1\right )}^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} + \frac {1114200 \, a^{2} {\left (\cos \left (d x + c\right ) - 1\right )}^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}} + \frac {491520 \, a b {\left (\cos \left (d x + c\right ) - 1\right )}^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}} + \frac {2171610 \, a^{2} {\left (\cos \left (d x + c\right ) - 1\right )}^{4}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{4}} + \frac {860160 \, a b {\left (\cos \left (d x + c\right ) - 1\right )}^{4}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{4}} + \frac {2736972 \, a^{2} {\left (\cos \left (d x + c\right ) - 1\right )}^{5}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{5}} + \frac {516096 \, a b {\left (\cos \left (d x + c\right ) - 1\right )}^{5}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{5}} - \frac {258048 \, b^{2} {\left (\cos \left (d x + c\right ) - 1\right )}^{5}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{5}} + \frac {2171610 \, a^{2} {\left (\cos \left (d x + c\right ) - 1\right )}^{6}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{6}} + \frac {1114200 \, a^{2} {\left (\cos \left (d x + c\right ) - 1\right )}^{7}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{7}} + \frac {382545 \, a^{2} {\left (\cos \left (d x + c\right ) - 1\right )}^{8}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{8}} + \frac {78850 \, a^{2} {\left (\cos \left (d x + c\right ) - 1\right )}^{9}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{9}} + \frac {7381 \, a^{2} {\left (\cos \left (d x + c\right ) - 1\right )}^{10}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{10}}}{{\left (\frac {\cos \left (d x + c\right ) - 1}{\cos \left (d x + c\right ) + 1} + 1\right )}^{10}}}{2520 \, d} \]

[In]

integrate((a+b*sec(d*x+c))^2*tan(d*x+c)^9,x, algorithm="giac")

[Out]

1/2520*(2520*a^2*log(abs(-(cos(d*x + c) - 1)/(cos(d*x + c) + 1) + 1)) - 2520*a^2*log(abs(-(cos(d*x + c) - 1)/(
cos(d*x + c) + 1) - 1)) + (7381*a^2 + 4096*a*b + 78850*a^2*(cos(d*x + c) - 1)/(cos(d*x + c) + 1) + 40960*a*b*(
cos(d*x + c) - 1)/(cos(d*x + c) + 1) + 382545*a^2*(cos(d*x + c) - 1)^2/(cos(d*x + c) + 1)^2 + 184320*a*b*(cos(
d*x + c) - 1)^2/(cos(d*x + c) + 1)^2 + 1114200*a^2*(cos(d*x + c) - 1)^3/(cos(d*x + c) + 1)^3 + 491520*a*b*(cos
(d*x + c) - 1)^3/(cos(d*x + c) + 1)^3 + 2171610*a^2*(cos(d*x + c) - 1)^4/(cos(d*x + c) + 1)^4 + 860160*a*b*(co
s(d*x + c) - 1)^4/(cos(d*x + c) + 1)^4 + 2736972*a^2*(cos(d*x + c) - 1)^5/(cos(d*x + c) + 1)^5 + 516096*a*b*(c
os(d*x + c) - 1)^5/(cos(d*x + c) + 1)^5 - 258048*b^2*(cos(d*x + c) - 1)^5/(cos(d*x + c) + 1)^5 + 2171610*a^2*(
cos(d*x + c) - 1)^6/(cos(d*x + c) + 1)^6 + 1114200*a^2*(cos(d*x + c) - 1)^7/(cos(d*x + c) + 1)^7 + 382545*a^2*
(cos(d*x + c) - 1)^8/(cos(d*x + c) + 1)^8 + 78850*a^2*(cos(d*x + c) - 1)^9/(cos(d*x + c) + 1)^9 + 7381*a^2*(co
s(d*x + c) - 1)^10/(cos(d*x + c) + 1)^10)/((cos(d*x + c) - 1)/(cos(d*x + c) + 1) + 1)^10)/d

Mupad [B] (verification not implemented)

Time = 17.87 (sec) , antiderivative size = 344, normalized size of antiderivative = 1.86 \[ \int (a+b \sec (c+d x))^2 \tan ^9(c+d x) \, dx=\frac {\frac {512\,a\,b}{315}+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4\,\left (20\,a^2+\frac {512\,b\,a}{7}\right )-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,\left (2\,a^2+\frac {1024\,b\,a}{63}\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8\,\left (\frac {740\,a^2}{3}+\frac {1024\,b\,a}{3}\right )-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6\,\left (\frac {272\,a^2}{3}+\frac {4096\,b\,a}{21}\right )+\frac {740\,a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{12}}{3}-\frac {272\,a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{14}}{3}+20\,a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{16}-2\,a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{18}-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{10}\,\left (348\,a^2+\frac {1024\,a\,b}{5}-\frac {512\,b^2}{5}\right )}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{20}-10\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{18}+45\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{16}-120\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{14}+210\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{12}-252\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{10}+210\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8-120\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+45\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4-10\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )}+\frac {2\,a^2\,\mathrm {atanh}\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\right )}{d} \]

[In]

int(tan(c + d*x)^9*(a + b/cos(c + d*x))^2,x)

[Out]

((512*a*b)/315 + tan(c/2 + (d*x)/2)^4*((512*a*b)/7 + 20*a^2) - tan(c/2 + (d*x)/2)^2*((1024*a*b)/63 + 2*a^2) +
tan(c/2 + (d*x)/2)^8*((1024*a*b)/3 + (740*a^2)/3) - tan(c/2 + (d*x)/2)^6*((4096*a*b)/21 + (272*a^2)/3) + (740*
a^2*tan(c/2 + (d*x)/2)^12)/3 - (272*a^2*tan(c/2 + (d*x)/2)^14)/3 + 20*a^2*tan(c/2 + (d*x)/2)^16 - 2*a^2*tan(c/
2 + (d*x)/2)^18 - tan(c/2 + (d*x)/2)^10*((1024*a*b)/5 + 348*a^2 - (512*b^2)/5))/(d*(45*tan(c/2 + (d*x)/2)^4 -
10*tan(c/2 + (d*x)/2)^2 - 120*tan(c/2 + (d*x)/2)^6 + 210*tan(c/2 + (d*x)/2)^8 - 252*tan(c/2 + (d*x)/2)^10 + 21
0*tan(c/2 + (d*x)/2)^12 - 120*tan(c/2 + (d*x)/2)^14 + 45*tan(c/2 + (d*x)/2)^16 - 10*tan(c/2 + (d*x)/2)^18 + ta
n(c/2 + (d*x)/2)^20 + 1)) + (2*a^2*atanh(tan(c/2 + (d*x)/2)^2))/d